﻿<UserControl
    x:Class="Notepads.Controls.DiffViewer.SideBySideDiffViewer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource SystemControlForegroundTransparentBrush}">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.ThemeDictionaries>
                <ResourceDictionary x:Key="Light">
                    <SolidColorBrush x:Key="RightBoxBackgroundThemeBrush"
                                     Opacity="0.25"
                                     Color="White"/>
                    <SolidColorBrush x:Key="HeaderBackgroundThemeBrush"
                                     Opacity="0.35"
                                     Color="LightGray"/>
                </ResourceDictionary>
                <ResourceDictionary x:Key="Dark">
                    <SolidColorBrush x:Key="RightBoxBackgroundThemeBrush"
                                  Opacity="0.15"
                                  Color="Black"/>
                    <SolidColorBrush x:Key="HeaderBackgroundThemeBrush"
                                     Opacity="0.2"
                                     Color="Black"/>
                </ResourceDictionary>
                <ResourceDictionary x:Key="HighContrast">
                    <SolidColorBrush x:Key="RightBoxBackgroundThemeBrush"
                                     Color="{ThemeResource SystemColorHighlightColor}"/>
                    <SolidColorBrush x:Key="HeaderBackgroundThemeBrush"
                                     Color="{ThemeResource SystemColorHighlightColor}"/>
                </ResourceDictionary>
            </ResourceDictionary.ThemeDictionaries>
        </ResourceDictionary>

    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid Column="0">

            <Grid.RowDefinitions>
                <RowDefinition Height="25"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <Grid Row="0" Background="{ThemeResource HeaderBackgroundThemeBrush}">
                <TextBlock Grid.Row="0"
                           x:Uid="DiffViewer_Header_OldTextTittle"
                           FontStyle="Italic"
                           HorizontalAlignment="Center"
                           VerticalAlignment="Center">
                </TextBlock>
                <Button x:Name="DismissButton"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Left"
                        IsTabStop="False"
                        Padding="0"
                        Height="25"
                        Width="32"
                        FontSize="12"
                        Style="{StaticResource DismissButtonStyle}"
                        Content="&#xE894;" 
                        FontFamily="Segoe MDL2 Assets">
                    <Button.KeyboardAccelerators>
                        <KeyboardAccelerator Key="Escape"/>
                    </Button.KeyboardAccelerators>
                </Button>
            </Grid>

            <ScrollViewer Name="LeftScroller"
                              Grid.Row="1"
                              IsTabStop="False"
                              Padding="6, 0, 8, 6"
                              HorizontalScrollBarVisibility="Hidden"
                              VerticalScrollBarVisibility="Hidden">
                <Border Name="LeftTextBlockBorder" Background="Transparent">
                    <RichTextBlock Name="LeftTextBlock"
                                   FontFamily="Consolas"/>
                </Border>
            </ScrollViewer>
        </Grid>

        <Grid Column="1" Background="{ThemeResource RightBoxBackgroundThemeBrush}">

            <Grid.RowDefinitions>
                <RowDefinition Height="25"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <Grid Row="0" Background="{ThemeResource HeaderBackgroundThemeBrush}">
                <TextBlock Grid.Row="0"
                           x:Uid="DiffViewer_Header_NewTextTittle"
                           FontStyle="Italic"
                           HorizontalAlignment="Center"
                           VerticalAlignment="Center">
                </TextBlock>
            </Grid>

            <ScrollViewer Name="RightScroller"
                          Grid.Row="1"
                          IsTabStop="False"
                          Padding="6, 0, 8, 6"
                          HorizontalScrollBarVisibility="Auto"
                          VerticalScrollBarVisibility="Auto">
                <Border Name="RightTextBlockBorder" Background="Transparent">
                    <RichTextBlock Name="RightTextBlock"
                                   FontFamily="Consolas"/>
                </Border>
            </ScrollViewer>
        </Grid>
    </Grid>
</UserControl>
